﻿using System;
using System.Collections.Generic;
using System.Text;

namespace UndoCommandSample
{
    class AddCommand : Command
    {
        private int value;
        private Adder Adder=null;

        public AddCommand()
        {
            this.Adder =new Adder();
        }

        public override int Excute(int value)
        {
            this.value = value;

            return Adder.Add(value);
        }

        public override int Undo()
        {
            return Adder.Add(-value);
            
        }
    }
}
